'''
下面这些是看
h5文件的代码，里面放置了所有需要的信息文件，我看了下维度是(4392, 2, 16, 8)
共有4396个16*8的帧点图(一个图两个矩阵)，每个图都是一个下面这样的格式  （图里每个点都是人流大小，两个18*6矩阵分别是入和出）
[[[ 0.  0.  0.  1.  0.  0.  0.  0.]
  [ 0.  0.  0.  1.  2.  1.  0.  0.]
  [ 0.  0.  0.  1.  0.  1.  0.  0.]
  [ 0.  1.  1.  0.  0.  0.  0.  0.]
  [ 0.  0.  1.  0.  0.  1.  0.  0.]
  [ 0.  1.  0.  0.  1.  0.  0.  0.]
  [ 0.  0.  1.  0.  0.  0.  0.  0.]
  [ 0.  0.  0.  3.  1.  0.  0.  0.]
  [ 0.  0.  0.  0.  1.  0.  0.  0.]
  [ 0.  0.  1.  0.  2.  0.  1.  0.]
  [ 1.  0.  0.  0.  1.  0.  0.  0.]
  [ 1.  0.  0.  0.  0.  0.  0.  0.]
  [ 0.  0.  0.  1.  0.  0.  0.  0.]
  [ 0.  0.  0.  0.  0.  0.  2.  0.]
  [ 0.  0.  0.  1.  0.  0.  0.  0.]
  [ 0.  0.  0.  0.  0.  0.  0.  0.]]

 [[ 0.  0.  0.  0.  0.  0.  0.  0.]
  [ 0.  0.  0.  1.  0.  1.  0.  0.]
  [ 0.  0.  0.  1.  0.  2.  1.  0.]
  [ 0.  0.  0.  1.  0.  0.  0.  0.]
  [ 0.  2.  0.  0.  0.  1.  0.  0.]
  [ 0.  0.  1.  0.  0.  0.  0.  0.]
  [ 0.  0.  0.  2.  0.  0.  0.  0.]
  [ 0.  1.  0.  4.  1.  0.  0.  0.]
  [ 0.  0.  1.  1.  2.  0.  0.  0.]
  [ 2.  0.  0.  1.  0.  0.  0.  0.]
  [ 0.  1.  1.  0.  0.  0.  1.  0.]
  [ 0.  0.  0.  0.  0.  0.  0.  0.]
  [ 0.  0.  0.  0.  0.  0.  0.  0.]
  [ 0.  0.  0.  0.  0.  1.  0.  0.]
  [ 0.  0.  0.  0.  0.  0.  0.  0.]
  [ 0.  0.  0.  0.  1.  0.  0.  0.]]]

value存放的是时间戳，data里面直接存放的是流量矩阵
  可以查看value，能展示出所有的日期，日期范围是2014040101-2014093024 这段时间，挺多的，足够有4392个了，这些时间段的数据参与训练

在h5文件中分别是data和date，他俩不一样啊，之前都没看到，一个放的是日期，一个放的是2*16*8的矩阵，对了value是所有的值，也可以单下标获取
'''
import h5py
import time
#f = h5py.File('NYC14_M16x8_T60_NewEnd.h5')
f = h5py.File('G:/Machine-learning/tensorflow-train-project(jupyter)/KDD-FreshAir/kDD 2018/Data/final_merge_aq_grid_meo_with_weather.h5','r')   #打开h5文件
c=f.keys()
print(c)
#查看主键,以及主键的shape
for key in c:
    print (f[key].shape)
#可以查看所有的主键数据集的具体内容
timestamps = f['date'].value
print (timestamps)
data=f['data'][2]#获取所有的键值
print(data)
f.close()
#print(data)